<!DOCTYPE html>
<html lang="en">
<head>
	<{include file="header.html"}>
	<title>课程明细-添加课程-<{$user_data['school_name']}>-德安信会计在线教育平台</title>
	<script>
	$(function(){
		$("#btn_save").click(function(){
			$("form").submit();
		});
	})
	</script>
</head>
<body>
	<div class="wrap">
		<!--star left-->
		<div class="column">
			<{include file="left_menu.html"}>
		</div>
		<div id="ContMianBox">
			<div class="sub-colum">
			    <div class="tit">会员管理</div>
			    <ul>
						<{foreach from=$left_menu_min.list item=item}>
						<li <{if $item['url'] == $left_menu_min.curr}>class="curr"<{/if}>><a href="<{$item['url']}>"><{$item['name']}></a></li>
						<{/foreach}>
			    </ul>
			</div>

			<!--end left-->
			<div class="container narrow">
			    <!--star conter-->
			    <div class="cetContent">
					<div class="tit p-lr20">
					    <a class="c-40d064" href="/users">课程明细</a><em class="p-lr10 c-CCCCCC fs12">/</em><em>添加课程</em>
					</div>
					<!--star内容区域-->
					<div class="mainScroll">
					    <div class="mainContainer line-all">

					        <div class="tabMainCont">

				            <!--star 编辑基本信息-->
				            <div class="tabItem step-02">
								<form method="post" class="layui-form">
									<div class="layui-form-item">
									 	<label class="layui-form-label">类型：</label>
									 	<div class="layui-input-inline">
											<input class="layui-input" value="<{$type_name}>" readonly>
									 	</div>
									</div>

									<div class="layui-form-item">
									 	<label class="layui-form-label">会员编号：</label>
									 	<div class="layui-input-inline">
											<input class="layui-input" value="<{$user['id']}>" readonly>
									 	</div>
									</div>

									<div class="layui-form-item">
									 	<label class="layui-form-label">会员姓名：</label>
									 	<div class="layui-input-inline">
										 	<input class="layui-input" value="<{$user['nick']}>" readonly>
									 	</div>
									</div>

									<div class="layui-form-item">
							    		<label class="layui-form-label">手机号：</label>
										<div class="layui-input-inline">
											<input class="layui-input" value="<{$user['mobile']}>" readonly>
							  			</div>
							  		</div>

							  		<input type="hidden" name="data_type" value="<{$data_type}>">

							  		<{if $data_type == 4}>
							  		<div class="layui-form-item">
							    		<label class="layui-form-label">选择科目：</label>
										<div class="layui-input-inline">
											<select name="data_id" id="choise_data" lay-filter="choise_data">
												<{foreach from=$data item=item}>
												<option value="<{$item.id}>" data_type="4" school_id="<{$item.school_id}>"><{$item.title}></option>
												<{/foreach}>
											</select>
							  			</div>
							  			<div class="layui-input-inline">
							  			<input type="text" name="code" id="code" readonly class="layui-input">
							  			</div>
							  		</div>
							  		<{else if $data_type == 5}>
							  		<div class="layui-form-item">
							    		<label class="layui-form-label">选择实训：</label>
										<div class="layui-input-inline">
											<select name="data_id" id="choise_data" lay-filter="choise_data">
												<{foreach from=$data item=item}>
												<option value="<{$item.Id}>" data_type="5" school_id="0"><{$item.ztName}></option>
												<{/foreach}>
											</select>
							  			</div>
							  			<div class="layui-input-inline">
							  			<input type="text" name="code" id="code" readonly class="layui-input">
							  			</div>
							  		</div>
							  		<{else}>
							  		<div class="layui-form-item">
							    		<label class="layui-form-label">选择课程：</label>
										<div class="layui-input-inline">
											<select name="data_id" id="choise_data" lay-filter="choise_data">
												<{foreach from=$data item=item}>
												<option value="<{$item.id}>" data_type="<{$item.type}>" school_id="<{$item.school_id}>"><{$item.title}></option>
												<{/foreach}>
											</select>
							  			</div>
							  			<div class="layui-input-inline">
							  			<input type="text" name="code" id="code" readonly class="layui-input">
							  			</div>
							  		</div>

							  		<{/if}>
							  		

									<div class="layui-form-item">
								 		<div class="layui-input-block">
									 		<button class="layui-btn" lay-submit lay-filter="*">确定添加</button>
									 		<button type="reset" class="layui-btn layui-btn-primary" onclick="history.go(-1)">取消</button>
								 		</div>
									</div>
					            </form>
				            </div>
					            <!--end 编辑基本信息-->
					        </div>
					    </div>
					</div>
				</div>
		</div>


	</div>
</div>
<{include file="footer.html"}>
<script>
	layui.use(['form','jquery'], function(){
		var form = layui.form(),$ = layui.jquery;
		$("#code").click(function(){
			var code = $(this).val();
			var school_id = $("#choise_data").find("option:selected").attr("school_id");
	        var data_type = $("#choise_data").find("option:selected").attr("data_type");
	        var data_id = $("#choise_data").val();
	        if(school_id == 0){
	        	//使用授权码
	        	layer.open({
			        type: 2,
			        title: '激活码列表',
			        shadeClose: true,
			        shade: 0.8,
			        area: ['90%', '90%'],
			        maxmin: true,
			        content: "/users/school_order_records/"+data_id+"/"+data_type+"/"+code //iframe的url
			    }); 
	        }
		})
		form.on('select(choise_data)',function(data){
	        // var ii = layer.load();
	        // layer.close(ii);
	        var school_id = $(data.elem).find("option:selected").attr("school_id");
	        var data_type = $(data.elem).find("option:selected").attr("data_type");
	        var data_id = data.value;
	        var code = $("#code").val();
	        if(school_id == 0){
	        	//使用授权码
	        	layer.open({
			        type: 2,
			        title: '激活码列表',
			        shadeClose: true,
			        shade: 0.8,
			        area: ['90%', '90%'],
			        maxmin: true,
			        content: "/users/school_order_records/"+data_id+"/"+data_type+"/"+code //iframe的url
			    }); 
	        }
	    });
	});
	
</script>

</body>
</html>